class Solution
{
public:
    int exchangeBits(int num)
    {
        int a = num & 0xaaaaaaaa;
        int b = num & 0x55555555;
        return a << 1 | b >> 1;
    }
};